<?php
class CultivationResearchStartAction extends SzAbstractAction {
    protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
    );

    /**
     * @param $userId
     * @param $subNum
     * @param $reqTime
     * @return SzResponse
     * @throws SzException
     */
    public function execute($userId,$subNum,$reqTime) {
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_CULTIVATION_RESEARCH_FUNC)) {
            return $this->buildResponse(false);
        }

        GameService::get()->validateMultiRequestTimeDelta($userId, $reqTime);
        $res = CultivationResearchService::get()->startResearch($userId,$subNum,$reqTime);
        return $this->buildResponse(
            $res
        );
    }
}